<?php
global $_W, $_GPC;
load()->func('tpl');
$html_title = $_W['current_module']['title'];
$op = !empty($_GPC['op']) ? $_GPC['op'] : '';
$extra = !empty($_GPC['extra']) ? $_GPC['extra'] : '';
$isactive = 'notice';
$page = max(1,$_GPC['page']);
if($op == 'index'){
    if(is_post()){
        $pagesize = 20;
        $start = ($page - 1) * $pagesize;
        $sql = "select title,content,status,create_time from ims_yq_haircircle_notice where delete_time=0 and status=1 order by id desc,status limit $start,$pagesize";
        $list = pdo_fetchall($sql);
        if(empty($list)){
            ajaxSuccess('success',$list);
        }
        foreach ($list as $k => $v){
            $list[$k]['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
        }
        ajaxSuccess('success',$list);
    }
    $html_title = '公告列表';
    include $this->template('notice_index');exit;
}
